/**
 * @file
 * JavaScript utilities.
 *
 * Declares and defines some useful constants, global variables, functions, etc.
 */

/**
 * Trims a string.
 *
 * @param str
 *    The string to trim.
 */
function trim(str) {
	return str.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}

/**
 * Left trims a string.
 *
 * @param str
 *    The string to trim.
 */
function ltrim(str) {
	return str.replace(/^\s\s*/, "");
}

/**
 * Right trims a string.
 *
 * @param str
 *    The string to trim.
 */
function rtrim(str) {
	return str.replace(/\s\s*$/, "");
}
